package com.design.observer;

public class InterpreterPattern {
	public static void main(String[] args) {
		Context context = new Context();
	    TerminalExpression a = new TerminalExpression("a");
	    TerminalExpression b = new TerminalExpression("b");
	    TerminalExpression c = new TerminalExpression("c");
	    
	    context.put(a, 4);
	    context.put(b, 8);
	    context.put(c, 2);

	    System.out.println(new MinusOperation(new PlusOperation(a,b), c).interpreter(context));
	}
}
